<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="ct-popout-iframe.html">

<polymer-element name="ct-test-output" attributes="type url">
    <template>
        <style>
            .result {
                border: 1px solid gray;
                line-height: 0;
            }
            img {
                width: 100%;
            }
            ct-popout-iframe {
                height: 400px;
            }
        </style>

        <div class="result" flex layout vertical>
            <template if="{{url}}">
                <template if="{{type == _kImageType}}">
                    <img src="{{url}}">
                </template>
                <template if="{{type == _kTextType}}">
                    <ct-popout-iframe src="{{url}}" flex></ct-popout-iframe>
                </template>
                <template if="{{type == _kAudioType}}">
                    <audio controls src="{{url}}"></audio>
                </template>
            </template>
        </div>
    </template>
    <script>
        Polymer({
            type: '',
            url: '',
            _kAudioType: results.kAudioType,
            _kImageType: results.kImageType,
            _kTextType: results.kTextType,
        });
    </script>
</polymer-element>
